<?php
/**
 * Created by PhpStorm.
 * User: Vova
 * Date: 10/5/14
 * Time: 5:59 PM
 */

define('SMARTY_DIR', 'C:/xampp/htdocs/door-market/Smarty-3.1.19/libs/');
require_once('C:/xampp/htdocs/door-market/php/classes/db.class.php');


require_once("C:/xampp/htdocs/door-market/php/classes/Host_config.class.php");

require_once(SMARTY_DIR . 'Smarty.class.php');

include_once("View.class.php");


class Catalog_view extends View{
    private $smarty;

    function __construct(){

    }
    public function display_catalog($catalog_items,$pages,$category_list,$category_mame,$category,$sub_category,$total_items_count,$sort_list,$page_size_list){

        /**
         * @todo Винести смарті в базовий клас
         */
        $smarty = new Smarty();

        $smarty->template_dir = 'C:/xampp/htdocs/door-market/templates/';
        $smarty->compile_dir  = 'C:/xampp/htdocs/door-market/templates_c';

        $host_name = Host_config::$host_name;

        $item_rel_host = Host_config::$item_rel_host.$category ."/".$sub_category."/";

        $smarty->assign('host_name',$host_name);




        $smarty->assign('pages',$pages);

        $smarty->assign('category_list',$category_list);

        $smarty->assign('total_items_count',$total_items_count);

        $smarty->assign('sort_list',$sort_list);

        $smarty->assign('page_size_list',$page_size_list);

        $smarty->assign('category_name',$category_mame);

        $smarty->assign('category',$category);


        $smarty->assign('sub_category',$sub_category);

        $smarty->assign('item_rel_host',$item_rel_host);


        $smarty->assign('items_container',$catalog_items);

        //
        $smarty->display('catalog.tpl');

    }


} 